package com.wwwarehouse.resource_center.adapter.binding_location_code;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.wwwarehouse.resource_center.R;
import com.wwwarehouse.resource_center.bean.binding_location_code.SelectBindWarehouseBean;

import java.util.List;


/**
 * Created by xiaoke.ni on 2017/10/17.
 */

public class SelectBindWarehouseAdapter extends RecyclerView.Adapter<SelectBindWarehouseAdapter.SelectBindWarehouseHolder> {

    /******需要修改的参数*****/
    private List<SelectBindWarehouseBean> mDataList;

    /******需要修改的参数*****/
    public SelectBindWarehouseAdapter(List<SelectBindWarehouseBean> dataList) {
        this.mDataList = dataList;
    }

    @Override
    public SelectBindWarehouseAdapter.SelectBindWarehouseHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_select_bind_warehouse, parent, false);
        return new SelectBindWarehouseAdapter.SelectBindWarehouseHolder(view);
    }

    @Override
    public void onBindViewHolder(SelectBindWarehouseAdapter.SelectBindWarehouseHolder holder, int position) {
        /******需要修改的参数*****/
        SelectBindWarehouseBean listBean = mDataList.get(position);
//        holder.mTvAuthName.setText(listBean.getUserName());
//        holder.mTvReason.setText(listBean.getFaileReason());
    }

    @Override
    public int getItemCount() {
        /******需要修改的参数*****/
        return mDataList == null ? 0 : mDataList.size();
    }

    static class SelectBindWarehouseHolder extends RecyclerView.ViewHolder {

        TextView mTvReason;
        TextView mTvAuthName;

        public SelectBindWarehouseHolder(View itemView) {
            super(itemView);
            mTvAuthName = (TextView) itemView.findViewById(R.id.tv_name);
            mTvReason = (TextView) itemView.findViewById(R.id.tv_detail_msg);
        }
    }
}
